make clean;
make;

if [ ! -d "task4" ]; then
	mkdir task4
fi

#rho = lambda/mu = 0.5, and mu = 1/3000 => lambda = 0.0001667

#fcfs M/M/1
echo "fcfs mm1"
./proj3 0.0001667 100000 0 0 0 > temp

startval=2
endval=100001
sed -n ${startval},${endval}p temp > task4/output_fcfs_mm1

#sjf M/M/1
echo "sjf mm1"
./proj3 0.0001667 100000 1 0 0 > temp

startval=2
endval=100001
sed -n ${startval},${endval}p temp > task4/output_sjf_mm1

#fcfs M/G/1
echo "fcfs mg1"
./proj3 0.0001667 100000 0 1 0 > temp

startval=2
endval=100001
sed -n ${startval},${endval}p temp > task4/output_fcfs_mg1

#sjf M/G/1
echo "sjf mg1"
./proj3 0.0001667 100000 1 1 0 > temp

startval=2
endval=100001
sed -n ${startval},${endval}p temp > task4/output_sjf_mg1

rm -f temp
echo "done"
